<template>
    <div class="bottom-box">
        <titleComponent title="项目管控"></titleComponent>
        <div class="center">
            <div class="center-box" v-for="item, i in list">
                <img src="../../../assets/img/img2.png" />
                <div>
                    <div class="name">{{ item.name }}</div>
                    <div class="value">{{ item.value }}</div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import titleComponent from "./titleComponent";
export default {
    components: {
        titleComponent,
    },
    watch: {
        mgr(val, oldVal) {
            if (val !== oldVal) {
                this.list = [
                    { name: "项目总数", value: val && val.totalMgr ? val.totalMgr : 0 },
                    { name: "在途项目", value: val && val.ztPro ? val.ztPro : 0 },
                    { name: "已结项项目", value: val && val.yjxPro ? val.yjxPro : 0 },
                    { name: "线索阶段商机", value: val && val.xsShangji ? val.xsShangji : 0 },
                    { name: "待预立项项目", value: val && val.dyLxPro ? val.dyLxPro : 0 },
                    { name: "预立项未中标", value: val && val.ylProNone ? val.ylProNone : 0 },
                    { name: "中标待立项", value: val && val.zbDlx ? val.zbDlx : 0 },
                    { name: "立项待签约", value: val && val.lxDqy ? val.lxDqy : 0 },
                    { name: "交付待验收", value: val && val.jfDys ? val.jfDys : 0 }
                ]
            }
        }
    },
    props: {
        mgr: {
            type: Object,
            default: () => { },
        }
    },
    data() {
        return {
            list: [
                { name: "项目总数", value: this.mgr && this.mgr.totalMgr ? this.mgr.totalMgr : 0 },
                { name: "在途项目", value: this.mgr && this.mgr.ztPro ? this.mgr.ztPro : 0 },
                { name: "已结项项目", value: this.mgr && this.mgr.yjxPro ? this.mgr.yjxPro : 0 },
                { name: "线索阶段商机", value: this.mgr && this.mgr.xsShangji ? this.mgr.xsShangji : 0 },
                { name: "待预立项项目", value: this.mgr && this.mgr.dyLxPro ? this.mgr.dyLxPro : 0 },
                { name: "预立项未中标", value: this.mgr && this.mgr.ylProNone ? this.mgr.ylProNone : 0 },
                { name: "中标待立项", value: this.mgr && this.mgr.zbDlx ? this.mgr.zbDlx : 0 },
                { name: "立项待签约", value: this.mgr && this.mgr.lxDqy ? this.mgr.lxDqy : 0 },
                { name: "交付待验收", value: this.mgr && this.mgr.jfDys ? this.mgr.jfDys : 0 }
            ]
        }
    },
}
</script>
<style lang="less" scoped>
.bottom-box {
    background: #fff;
    width: 100%;
    height: 424px;
    box-sizing: border-box;
    padding: 16px;
}

.center {
    display: flex;
    flex-wrap: wrap;
}

.center-box {
    display: flex;
    margin-top: 26px;
    width: 33.3%;
    flex-wrap: wrap;
    padding-left: 30px;
    box-sizing: border-box;

    img {
        margin-right: 20px;
        width: 70px;
        height: 90px;
    }

    .value {
        font-size: 20px;
        color: #0a1b2e;
        font-weight: bold;
    }
}

.name {
    font-size: 18px;
    margin-top: 30px;
}
</style>